package tables

import model "test_demo/models"

func (c *User) Add(user User) error {
	db:=model.DB.Begin()
	err:=db.Create(&user).Error
	db.Rollback()
	db.Commit()
	return err
}
func (c *User) QueryOne(user User) (*User,error) {
	query:=new(User)
	db:=model.DB
	err:=db.Where(user).First(&query).Error
	return query,err
}
